<?php

/**
 * This is the model class for table "{{free_trial}}".
 *
 * The followings are the available columns in table '{{free_trial}}':
 * @property integer $id
 * @property string $user_name
 * @property string $email
 * @property string $phone
 * @property string $country
 * @property string $state
 * @property string $comment
 * @property string $company
 * @property string $role
 * @property string $create_date
 * @property string $send_date
 * @property string $download_date
 */
class ContactUs extends CFormModel {

    public $first_name;
    public $last_name;
    public $email;
    public $country;
    public $state;
    public $phone;
    public $company;
    public $role;
    public $comment;
    public $security_code;


     /**
     * @return array validation rules for model attributes.
     */
    public function rules() {
        // NOTE: you should only define rules for those attributes that
        // will receive user inputs.
        return array(
            array('first_name, last_name, email, country, state, phone, company, security_code', 'required', 'message' => t('MSG_REQUIRED', 'messages')),
            array('email, country, company', 'length', 'max' => 200),
            array('first_name, last_name', 'length', 'max' => 100),
            array('email', 'email', 'message' => t('MSG_WRONG_EMAIL', 'messages')),
            array('phone', 'length', 'max' => 50),
            array('state, role', 'length', 'max' => 255),
            array('comment', 'length', 'max' => 8000),
            array('security_code', 'captcha', 'on' => 'active', 'message' => t('MSG_INCORECT_SECURITY_CODE', 'messages')),
        );
    }

    /**
     * @return array customized attribute labels (name=>label)
     */
    public function attributeLabels() {
        return array(
            'id' => 'ID',
            'first_name' => 'First name',
            'last_name' => 'Last name',
            'email' => 'Email',
            'phone' => 'Phone',
            'country' => 'Country',
            'state' => 'State',
            'comment' => 'Comment',
            'company' => 'Company',
            'role' => 'Role',
            'security_code' => 'Security code'
        );
    }
}